package si.yun.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import si.yun.dao.PersonnelDao;
import si.yun.entity.*;
import si.yun.service.PersonnelService;

import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @program: SiYunClass
 * @description: 人事业务层
 * @author: 崔晓晨
 * @create: 2021-07-28 20:50
 **/
@Service
public class PersonnelServiceImpl implements PersonnelService {
    @Autowired
    private PersonnelDao personnelDao;
    /**
     * @Description  查询用户的数据展示
     * @return si.yun.entity.PerCount
     * @Date 2021/7/29 14:19
     **/
    @Override
    public PerCount selUserNum() {
        PerCount p = new PerCount();
        int today = personnelDao.selUserToday();
        int yes = personnelDao.selUserYes();
        int mou = personnelDao.selUserMou();
        int Num = personnelDao.selUserNum();
        int passNum = personnelDao.selapplyPassNum();
        int afterUserNum = personnelDao.selAfterUserNum();
        int fee = personnelDao.selFeedBackWaitNum();
        int waitNum = personnelDao.selApplyWaitNum();
        p.setUserMou(mou);
        p.setUserNum(Num);
        p.setUserYes(yes);
        p.setUserToday(today);
        p.setAfterUserNum(afterUserNum);
        p.setApplyPassNum(passNum);
        p.setFeedbackWaitNum(fee);
        p.setApplyWaitNum(waitNum);
        return p;
    }
    /**
     * @Description  获取期间内申请人员统计信息
     * @return si.yun.entity.PerCount 
     * @Date 2021/7/28 21:32
     **/
    @Override
    public PerCount selPerTab(int durDate) {
        int perCount = personnelDao.selApplyNum();
        int perPass = personnelDao.selApplyPass(durDate);
        int applyRejection = personnelDao.selApplyRejection(durDate);
        String applyPosition = personnelDao.selApplyPosition(durDate);
        PerCount p = new PerCount();
        p.setApplyNum(perCount);
        p.setApplyPass(perPass);
        p.setApplyRejection(applyRejection);
        p.setApplyPosition(applyPosition);
        return p;
    }
    /**
     * @Description 获取用户统计量
     * @return list<Integer>
     * @Date 2021/7/29 13:28
     **/
    @Override
    public List<Integer> selUserEcharts() {
        int day1 = personnelDao.selUserday1();
        int day2 = personnelDao.selUserday2();
        int day3 = personnelDao.selUserday3();
        int day4 = personnelDao.selUserday4();
        int day5 = personnelDao.selUserday5();
        int day6 = personnelDao.selUserday6();
        int day7 = personnelDao.selUserday7();
        List<Integer> list = new ArrayList<>();
        list.add(day1);
        list.add(day2);
        list.add(day3);
        list.add(day4);
        list.add(day5);
        list.add(day6);
        list.add(day7);
        return list;
    }
    /**
     * @Description  获取用户列表
     * @return java.util.List<si.yun.entity.SyBeforeUser> 
     * @Date 2021/7/29 19:22
     **/
    @Override
    public List<SyBeforeUser> selUserTable(SyBeforeUser beforeUser) {
        List<SyBeforeUser> beforeUsers = personnelDao.selUserTable(beforeUser);
        return beforeUsers;
    }

    /**
     * @Description  添加停用的用户
     * @return int
     * @Date 2021/8/1 18:37
     **/
    @Transactional
    @Override
    public int addClosure(SyClosure closure) {
        int add = personnelDao.addClosure(closure);
        updBeforeStatus(closure.getUserId(),3);
        return add;
    }
    /**
     * @Description  查询单个用户的详细信息
     * @return si.yun.entity.SyBeforeUser 
     * @Date 2021/8/1 19:00
     **/
    @Override
    public SyBeforeUser selUserInfo(int userId) {
        List<Integer> backIds = personnelDao.selBackUserIds();
        List<Integer> beforeIds = personnelDao.selBeforeUserIds();
        for(Integer bacIds:backIds){
            for(Integer befoIds:beforeIds){
                if(userId==bacIds){
                    SyBeforeUser backUser = personnelDao.selBackUserInfoId(userId);
                    return backUser;
                }else if(userId==befoIds){
                    SyBeforeUser beforeUser = personnelDao.selBefoUserInfoId(userId);
                    return beforeUser;
                }
            }
        }
        return null;
    }
    /**
     * @Description  查询单个后台用户的详细信息
     * @return si.yun.entity.SyUser
     * @Date 2021/8/21 10:41
     **/
    @Override
    public SyUser selBackUserInfo(int userId) {
        SyUser syUser = personnelDao.selBackUserInfo(userId);
        return syUser;
    }
    /**
     * @Description  编译用户信息 ( 不能编译用户的学习时长  和 交易金额 以及 账号创建时间)
     * @return int 
     * @Date 2021/8/1 21:00
     **/
    @Override
    public int updSelUser(SyBeforeUser beforeUser) {
        int upd = personnelDao.updSelUser(beforeUser);
        return upd;
    }
    /**
     * @Description  查询封号用户列表
     * @return java.util.List<si.yun.entity.SyClosure>
     * @Date 2021/8/2 9:43
     **/
    @Override
    public List<SyClosure> selClosureUserTable(SyClosure closure) {
        List<SyClosure> closures = personnelDao.selClosureUserTable(closure);
        return closures;
    }
    /**
     * @Description  解封用户 改变封号列表信息
     * @return int 
     * @Date 2021/8/2 15:12
     **/
    @Override
    @Transactional
    public int updClosure(SyClosure closure) {
        String reason = closure.getReason();
        closure.setReason(reason+"(已解封)");
        int upd = personnelDao.updClosure(closure);
        int userId = closure.getUserId();
        int type = closure.getType();
        if(type==2){
            int status = 2;
            updBeforeStatus(userId,status);
        }else if(type==3){
            int status = 1;
            updBackUserStatus(userId,status);
        }
        return upd;
    }
    /**
     * @Description  更改用户账号的状态
     * @return int
     * @Date 2021/7/30 14:37
     **/
    public int updBeforeStatus(int userId,int status) {
        int upd = personnelDao.updBeforeStatus(userId,status);
        return upd;
    }
    public int updBackUserStatus(int userId,int status){
        int upd = personnelDao.updBackStatus(userId, status);
        return  upd;
    }
    /**
     * @Description  删除停用后的封停日志
     * @return int
     * @Date 2021/7/30 15:39
     **/
    @Override
    public int delBeforeStatus(int id) {
        int del = personnelDao.delBeforeStatus(id);
        return del;
    }
    /**
     * @Description  查询进思用户列表的详细数据
     * @return java.util.List<si.yun.entity.PerUserListThink> 
     * @Date 2021/8/3 10:07
     **/
    @Override
    public List<PerUserListThink> selThinkUserTable(PerUserListThink userThink) {
        List<PerUserListThink> list =  personnelDao.selThinkUserTable(userThink);
        return list;
    }
    /**
     * @Description  查看进思用户的详细信息
     * @return si.yun.entity.SyUserDevelopment 
     * @Date 2021/8/3 20:53
     **/
    @Override
    public PerUserListThink selUserThinkIndex(int developmentId) {
        PerUserListThink development = personnelDao.selUserThinkIndex(developmentId);
        return development;
    }
    /**
     * @Description  上传图片文件 更换头像
     * @return int 
     * @Date 2021/8/4 19:49
     **/
    @Override
    public int updImg(int developmentId, String newName, int userId) {
        int upd = personnelDao.updImg(developmentId,newName,userId);
        return upd;
    }
    /**
     * @Description  编译进思用户的基本信息
     * @return int 
     * @Date 2021/8/5 9:31
     **/
    @Override
    public int updThinkInfo(PerUserListThink perUserListThink) {
        int upd = personnelDao.updThinkInfo(perUserListThink);
        return upd;
    }
    /**
     * @Description  查询优惠券列表
     * @return java.util.List<si.yun.entity.OperCoupons> 
     * @Date 2021/8/5 10:56
     **/
    @Override
    public List<OperCoupons> selAwayListTab() {
        List<OperCoupons> list = personnelDao.selAwayListTab();
        return list;
    }
    /**
     * @Description  添加 赠送优惠券的优惠券记录
     * @return int
     * @Date 2021/8/5 14:14
     **/
    @Transactional
    @Override
    public int addUserCoupons(List<Integer> userId, List<Integer> couponId) {
        int add = personnelDao.addUserCoupons(userId,couponId);
        selGaveNum();
        return add;
    }
    public List<SyUserCoupon> selGaveNum(){
        List<SyUserCoupon> operCoupons = personnelDao.selGaveNum();
        updSurplus(operCoupons);
        return operCoupons;
    }
    public int updSurplus(List<SyUserCoupon> operCoupons){
        for(SyUserCoupon l:operCoupons){
            System.out.println(l.getSurplus());
            System.out.println(l.getCouponId());
        }
        System.out.println(operCoupons);
        int upd = personnelDao.updSurplus(operCoupons);
        return upd;
    }
    /**
     * @Description  添加进思用户列表
     * @return int
     * @Date 2021/8/6 11:07
     **/
    @Override
    public int addThinkUserInfo(SyUserDevelopment development) {
        int add = personnelDao.addThinkUserInfo(development);
        return add;
    }
    /**
     * @Description  添加后端操作日志
     * @return int 
     * @Date 2021/8/6 14:10
     **/
    @Override
    public int addOperationLog(SyOperationLog log) {
        int add = personnelDao.addOperationLog(log);
        return add;
    }
    /**
     * @Description  添加封号操作日志
     * @return int 
     * @Date 2021/8/6 16:22
     **/
    @Override
    public int addClosureLog(SyClosureLog syClosureLog) {
        int add = personnelDao.addClosureLog(syClosureLog);
        return add;
    }
    /**
     * @Description  查询封号日志表
     * @return java.util.List<si.yun.entity.PerClosureLog> 
     * @Date 2021/8/6 17:24
     **/
    @Override
    public List<PerClosureLog> selClosureLog(PerClosureLog log) {
        List<PerClosureLog> perClosureLogs = personnelDao.selClosureLog(log);
        return perClosureLogs;
    }
    /**
     * @Description  删除封号日志
     * @return int 
     * @Date 2021/8/9 9:12
     **/
    @Override
    public int delClosureLog(int id) {
        int del = personnelDao.delClosureLog(id);
        return del;
    }
    /**
     * @Description  查看操作日志数据
     * @return java.util.List<si.yun.entity.SyOperationLog>
     * @Date 2021/8/10 8:48
     **/
    @Override
    public List<SyOperationLog> selOperationLog(SyOperationLog operationLog) {
        List<SyOperationLog> syOperationLogs = personnelDao.selOperationLog(operationLog);
        return syOperationLogs;
    }
    /**
     * @Description  删除操作日志
     * @return int 
     * @Date 2021/8/10 9:17
     **/
    @Override
    public int delOperationLog(int id) {
        int del = personnelDao.delOperationLog(id);
        return del;
    }
    /**
     * @Description  获取非进思用户列表
     * @return java.util.List<si.yun.entity.SyBeforeUser>
     * @Date 2021/8/10 10:01
     **/
    @Override
    public List<SyBeforeUser> selNotThinkUser(SyBeforeUser beforeUser) {
        List<SyBeforeUser> beforeUsers = personnelDao.selNotThinkUser(beforeUser);
        return beforeUsers;
    }
    /**
     * @Description  查看前台用户反馈列表
     * @return java.util.List<si.yun.entity.PerFeedback>
     * @Date 2021/8/10 16:59
     **/
    @Override
    public List<PerFeedback> selFeedbackList(PerFeedback feedback) {
        List<PerFeedback> feedbacks = personnelDao.selFeedbackList(feedback);
        return feedbacks;
    }
    /**
     * @Description  查询待审核 已受理的数量（反馈列表）
     * @return si.yun.entity.PerFeedback 
     * @Date 2021/8/12 19:42
     **/
    @Override
    public PerFeedback selAduFeedNum() {
        PerFeedback feedback = new PerFeedback();
        int waitNum = personnelDao.selWaitNum();
        int acceptedNum = personnelDao.selAcceptedNum();
        feedback.setWaitNum(waitNum);
        feedback.setAcceptedNum(acceptedNum);
        return feedback;
    }
    /**
     * @Description  更新已受理状态
     * @return int 
     * @Date 2021/8/13 9:00
     **/
    @Override
    public int updFeedback(Integer feedbackStatus,Integer feedbackId) {
        int upd = personnelDao.updFeedback(feedbackStatus,feedbackId);
        return upd;
    }
    /**
     * @Description  查看受理详情
     * @return si.yun.entity.PerOperationLog 
     * @Date 2021/8/13 10:50
     **/
    @Override
    public PerOperationLog selReceiveInfo(String tablename, String remark) {
        PerOperationLog perOperationLog = personnelDao.selReceiveInfo(tablename, remark);
        return perOperationLog;
    }
    /**
     * @Description  删除反馈信息
     * @return int 
     * @Date 2021/8/13 11:30
     **/
    @Override
    public int delFeedback(Integer feedbackId) {
        int del = personnelDao.delFeedback(feedbackId);
        return del;
    }
    /**
     * @Description  查询无消费记录用户列表
     * @return java.util.List<si.yun.entity.SyBeforeUser>
     * @Date 2021/8/13 16:59
     **/
    @Override
    public List<SyBeforeUser> selNotSpendUser(SyBeforeUser beforeUser) {
        List<SyBeforeUser> beforeUsers = personnelDao.selNotSpendUser(beforeUser);
        return beforeUsers;
    }
    /**
     * @Description  查询部门数据管理列表
     * @return java.util.List<si.yun.entity.PerDept> 
     * @Date 2021/8/14 9:46
     **/
    @Override
    public List<PerDept> selDeptList(PerDept dept) {
        List<PerDept> perDepts = personnelDao.selDeptList(dept);
        return perDepts;
    }
    /**
     * @Description  更新部门启用 停用状态
     * @return int 
     * @Date 2021/8/14 15:00
     **/
    @Override
    public int updDeptStatus(Integer deptId, Integer deptStatus) {
        int upd = personnelDao.updDeptStatus(deptId,deptStatus);
        return upd;
    }
    /**
     * @Description  修改部门信息
     * @return int
     * @Date 2021/8/15 9:27
     **/
    @Override
    public int updDeptInfo(SyDept dept) {
        int upd = personnelDao.updDeptInfo(dept);
        return upd;
    }
    /**
     * @Description  添加部门
     * @return int 
     * @Date 2021/8/15 10:25
     **/
    @Override
    public int addDeptInfo(PerDept dept) {
        int add = personnelDao.addDeptInfo(dept);
        return add;
    }
    /**
     * @Description  删除部门信息
     * @return int 
     * @Date 2021/8/15 14:05
     **/
    @Override
    public int delDeptInfo(Integer deptId) {
        int del = personnelDao.delDeptInfo(deptId);
        return del;
    }
    /**
     * @Description  获取部门信息（树形）
     * @return java.util.List<si.yun.entity.PerDeptZtreeNode> 
     * @Date 2021/8/16 19:01
     **/
    @Override
    public List<PerDeptZtreeNode> selDeptName() {
        List<PerDeptZtreeNode> deptName = personnelDao.selDeptName();
        return deptName;
    }
    /**
     * @Description  获取后台管理员信息
     * @return java.util.List<si.yun.entity.SyUser> 
     * @Date 2021/8/16 20:21
     **/
    @Override
    public List<PerBackUser> selBackUserList(PerBackUser user) {
        List<PerBackUser> syUsers = personnelDao.selBackUserList(user);
        return syUsers;
    }
    /**
     * @Description  管理后台管理员账号的账户是否启用
     * @return int 
     * @Date 2021/8/17 15:45
     **/
    @Override
    public int updBackUserEnabled(Integer userId, Integer enabled) {
        int upd = personnelDao.updBackUserEnabled(userId,enabled);
        return upd;
    }
    /**
     * @Description  查找所有封停用户
     * @return java.util.List<si.yun.entity.PerClosureUser>
     * @Date 2021/8/20 21:02
     **/
    @Override
    public List<PerClosureUser> selClosureUser() {
        List<PerClosureUser> perClosureUsers = personnelDao.selClosureUser();
        return perClosureUsers;
    }
    /**
     * @Description  更改用户账号状态   封停用户账号
     * @return int 
     * @Date 2021/8/21 9:54
     **/
    @Override
    public int updBackUserStatus(Integer userId, Integer enabled, Integer status) {
        int upd = personnelDao.updBackUserStatus(userId, enabled, status);
        return upd;
    }
    /**
     * @Description  更新后台管理员信息
     * @return int
     * @Date 2021/8/25 10:12
     **/
    @Override
    public int updBackUserInfo(PerBackUser user) {
        int upd = personnelDao.updBackUserInfo(user);
        return upd;
    }
    /**
     * @Description  更新后台管理员头像
     * @return int
     * @Date 2021/8/25 15:36
     **/
    @Override
    public int updBackUserImg(String newName, int userId) {
        int upd = personnelDao.updBackUserImg(newName,userId);
        return upd;
    }
    /**
     * @Description  导入后台管理员
     * @return int
     * @Date 2021/8/27 20:07
     **/
    @Override
    public int importExcelUser(List<PerBackUser> syUsers) {
        int add = personnelDao.importExcelUser(syUsers);
        return add;
    }
    /**
     * @Description  添加后台管理人员
     * @return int 
     * @Date 2021/9/4 17:30
     **/
    @Override
    public int addBackUserInfo(PerBackUser backUser) {
        int add = personnelDao.addBackUserInfo(backUser);
        return add;
    }
    /**
     * @Description 获取今年每月新增的用户数量（用户）
     * @return java.util.List<si.yun.entity.UserMonth>
     * @Date 2021/9/9 18:32
     **/
    @Override
    public List<Integer> selBeforeNum() {
        UserMonth beforeUserNum = personnelDao.selBeforeNum();
        List<Integer> before = setList(beforeUserNum);
        return before;
    }
    /**
     * @Description 获取今年每月新增的用户数量（后端）
     * @return java.util.List<si.yun.entity.UserMonth>
     * @Date 2021/9/9 18:32
     **/
    @Override
    public List<Integer> selBackNum() {
        UserMonth backUserNum = personnelDao.selBackNum();
        List<Integer> back = setList(backUserNum);
        return back;
    }
    public List<Integer> setList(UserMonth userNum){
        List<Integer> list = new ArrayList<>();
        list.add(userNum.getJanuary());
        list.add(userNum.getFebruary());
        list.add(userNum.getMarch());
        list.add(userNum.getApril());
        list.add(userNum.getMay());
        list.add(userNum.getJune());
        list.add(userNum.getJuly());
        list.add(userNum.getAugust());
        list.add(userNum.getSeptember());
        list.add(userNum.getOctober());
        list.add(userNum.getNovember());
        list.add(userNum.getDecember());
        return list;
    }
    /**
     * @Description 获取人员登录总次数 成功次数（前端 ，管理端）
     * @return si.yun.entity.UserMonth
     * @Date 2021/9/10 9:47
     **/
    @Override
    public UserMonth selLoginNums() {
        UserMonth user = new UserMonth();
        Integer before = personnelDao.selBeforeLoginNum();
        Integer back = personnelDao.selBackLoginNum();
        user.setBackLoginNum(back);
        user.setBeforeLoginNum(before);
        return user;
    }
    /**
     * @Description  获取某一时间段内登录的数据(前)
     * @return java.util.List<java.lang.Integer> 
     * @Date 2021/9/10 9:11
     **/
    @Override
    public List<Integer> getLoginTime() {
        List<Integer> list = new ArrayList<>();
        Integer one = personnelDao.selTimeOne();
        Integer two = personnelDao.selTimeTwo();
        Integer three = personnelDao.selTimeThree();
        Integer fore = personnelDao.selTimeFore();
        Integer five = personnelDao.selTimeFive();
        list.add(one);
        list.add(two);
        list.add(three);
        list.add(fore);
        list.add(five);
        return list;
    }
    /**
     * @Description  获取某一时间段内登录的数据(管)
     * @return java.util.List<java.lang.Integer>
     * @Date 2021/9/10 9:11
     **/
    @Override
    public List<Integer> getLoginTimes() {
        List<Integer> list = new ArrayList<>();
        Integer one = personnelDao.selTimeOnes();
        Integer two = personnelDao.selTimeTwos();
        Integer three = personnelDao.selTimeThrees();
        Integer fore = personnelDao.selTimeFores();
        Integer five = personnelDao.selTimeFives();
        list.add(one);
        list.add(two);
        list.add(three);
        list.add(fore);
        list.add(five);
        return list;
    }
    /**
     * @Description  查询不同的反馈类型下不同的反馈结果数据
     * @return si.yun.entity.PerFeedData
     * @Date 2021/9/10 14:13
     **/
    @Override
    public PerFeedData selFeedDatas(Integer feedbackType) {
        PerFeedData perFeedData = personnelDao.selFeedDatas(feedbackType);
        return perFeedData;
    }
    /**
     * @Description  查询反馈的总数
     * @return si.yun.entity.PerFeedData
     * @Date 2021/9/10 14:14
     **/
    @Override
    public PerFeedData selFeedBackNums() {
        PerFeedData perFeedData = personnelDao.selFeedBackNums();
        return perFeedData;
    }
    /**
     * @Description  查询不同类型下的课程视频播放量
     * @return java.util.List<si.yun.entity.PerCourseLook> 
     * @Date 2021/9/10 19:08
     **/
    @Override
    public List<PerCourseLook> selCourseLookNum() {
        List<PerCourseLook> perCourseLooks = personnelDao.selCourseLookNum();
        return perCourseLooks;
    }
    /**
     * @Description  查询搜索统计量
     * @return java.util.List<si.yun.entity.SySearch> 
     * @Date 2021/9/11 11:54
     **/
    @Override
    public List<SySearch> selSearchNums() {
        List<SySearch> sySearches = personnelDao.selSearchNums();
        return sySearches;
    }




    /**
     * @author: DZQ
     * @description: 获取表格和查询结果表格
     * @date: 2021/8/6 10:27
     * @return  list
     */
    @Override
    public List<Map<String,Object>> getTable(String account, String nickname, String applyDate,Integer result) {
        List<Map<String,Object>> list=personnelDao.getTable(account,nickname,applyDate,result);
        System.out.println(list);
        return list;
    }
    /**
     * @author: DZQ
     * @description: 高级检索查询表格
     * @date: 2021/8/6 10:27
     * @return  list
     */
    @Override
    public List<Map<String, Object>> getTable1(String account, String phone, String position, String nickname) {
        List<Map<String,Object>> list=personnelDao.getTable1(account,phone,position,nickname);
        return list;
    }
    /**
     * @author: DZQ
     * @description: 查询该用户审核信息
     * @date: 2021/8/4 9:05
     * @return  SyAudiTabled对象
     */
    @Override
    public SyAudiTable view(Integer id) {
        SyAudiTable tab=personnelDao.view(id);
        return tab;
    }

    /**
     * @author: DZQ
     * @description: 查询用户信息
     * @date: 2021/8/14 8:37
     * @return
     */
    @Override
    public SyAudiTable view1(Integer id, String result) {
        SyAudiTable tab=personnelDao.view1(id,result);
        return tab;
    }

    /**
     * @author: DZQ
     * @description: 审核通过
     * @date: 2021/8/10 15:30
     * @return
     */
    @Override
    @Transactional
    public int audit(String textarea, String remarks, String applyDate, String position, Integer launchId, Integer pass) {
        int a=personnelDao.audit( textarea,  remarks,  applyDate,  position, launchId ,pass);
        int a1=status(launchId);
        int sun=a+a1;
        return sun;
    }


    @Transactional
    public int status(int launchId){
        int a1=personnelDao.status(launchId);
        return a1;
    }

    /**
     * @author: DZQ
     * @description: 审核驳回
     * @date: 2021/8/10 15:30
     * @return
     */
    @Transactional
    @Override
    public int rejected(String textarea, String remarks, String applyDate, String position, Integer launchId , Integer pass) {
        int a=personnelDao.rejected( textarea,  remarks,  applyDate,  position, launchId , pass);
        int a1=state(launchId);
        int sun=a+a1;
        return sun;
    }
    @Transactional
    public int state(int launchId){
        int a1=personnelDao.state(launchId);
        return a1;
    }


    /**
     * @author: DZQ
     * @description: 审核驳回通过表单
     * @date: 2021/8/13 10:27
     * @return
     */
    @Override
    public List<Map<String, Object>> SelTab(String result) {
        List<Map<String,Object>> list=personnelDao.SelTab(result);
        return list;
    }

    /**
     * @author: DZQ
     * @description: 审核通过信息
     * @date: 2021/8/14 9:17
     * @return
     */
    @Override
    public SyAudiTable Review(Integer id) {
        SyAudiTable tab=personnelDao.Review(id);
        return tab;
    }
    /**
     * @author: DZQ
     * @description: 获取未审核，通过，驳回数量
     * @date: 2021/8/15 9:53
     * @return
     */
    @Override
    public Map<String,Object> getNumber(Integer result1,Integer result2,Integer result3) {
        int list=personnelDao.getNumber(result1);
        int list1=personnelDao.getNumber1(result2);
        int list2=personnelDao.getNumber2(result3);
        Map<String,Object> m = new HashMap<>();
        m.put("auditNumber",list);
        m.put("approvedNumber",list1);
        m.put("rejectNumber",list2);
        return m;
    }


    /**
     * @author: DZQ
     * @description: 后台用户登录日志
     * @date: 2021/8/16 20:37
     * @return
     */
    @Override
    public List<Map<String, Object>> GetTab(int loginType) {
        List<Map<String,Object>> list=personnelDao.GetTab(loginType);
        System.out.println(list);
        return list;
    }
    /**
     * @author: DZQ
     * @description: 前台用户登录日志
     * @date: 2021/8/16 20:37
     * @return
     */
    @Override
    public List<Map<String, Object>> ConLog(int loginType) {
        List<Map<String,Object>> list=personnelDao.ConLog(loginType);
        System.out.println(list);
        return list;
    }
    /**
     * @author: DZQ
     * @description: 查询前台用户按钮
     * @date: 2021/9/11 19:18
     * @return
     */
    @Override
    public List<Map<String, Object>> deskUser(String loginLocation, String realName, Integer loginState, Integer loginType) {
        List<Map<String,Object>> list=personnelDao.deskUser(loginLocation,realName,loginState,loginType);
        return list;
    }
    /**
     * @author: DZQ
     * @description: 查询后台用户按钮
     * @date: 2021/9/11 19:19
     * @return
     */
    @Override
    public List<Map<String, Object>> Background(String loginLocation, String trueName, Integer loginState, Integer loginType) {
        List<Map<String,Object>> list=personnelDao.Background(loginLocation,trueName,loginState,loginType);
        return list;
    }
    /**
     * @author: DZQ
     * @description: 获取前后台登录日志总数
     * @date: 2021/9/11 20:43
     * @return
     */
    @Override
    public Map<String, Object> getTotal(Integer result1, Integer result2) {
        int list=personnelDao.getTotal1(result1);
        int list1=personnelDao.getTotal2(result2);
        Map<String,Object> m = new HashMap<>();
        m.put("beforeNumber",list);
        m.put("afterNumber",list1);
        return m;
    }
}
